package com.gopay.bis.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Random;

/**
 * @author ddh02
 * @Log4j2TestController
 * @2018/3/6 14:35  www.gopay.com.cn Inc.All rights reserved.
 */

@Controller
public class Log4j2TestController {

    private static final Logger LOGGER = LoggerFactory.getLogger(Log4j2TestController.class);

    @RequestMapping("log/test")
    @ResponseBody
    private String excute() {

        LOGGER.info("start ===========================");
        long start = System.currentTimeMillis();
        int t = 100;
        for (int j = 0; j < t; j++) {
            LOGGER.info("info" + new Random().nextInt(10000));
        }

        long time = (System.currentTimeMillis() - start);

        LOGGER.info("end ===========================" + time);

        return "ok";
    }


}
